<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.io.*,java.sql.*,java.util.*,java.net.*,java.text.*"%>
<%@ page import="com.yuxin.common.util.*" %>
<%@ page import="com.yuxin.core.exception.SiteRuntimeException" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    Connection conn = DBUtil.getConnection();
    String pClasss = request.getParameter("pClass");// 分类ID
    try{
        String sql = "SELECT ID,TITLE,TITLE_IMG,PRICE,AMOUNT,UPDATE_TIME FROM P_GOODS WHERE P_CLASS = ? AND STATUS = '2' ORDER BY UPDATE_TIME DESC ";
        List dataList = DBUtil.queryList(conn,sql,pClasss);
        request.setAttribute("titleName",URLDecoder.decode(request.getParameter("name"), "UTF-8"));
        request.setAttribute("dataList",dataList);
    }catch (Exception e){
        e.printStackTrace();
        throw new SiteRuntimeException(e);
    }finally {
        DBUtil.close(conn);
    }
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>${titleName}</title>
    <meta name="Keywords" content="中信信用卡平台" />
    <meta name="Description" content="${titleName}"/>
    <meta name="robots" content="all"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta http-equiv="cleartype" content="on"/>
    <link rel="icon" type="image/png" href="images/favicon.ico">
    <%@ include file="/site/css.jsp" %>
</head>
<body>
<div id="page">
    <%@ include file="/site/header_nav.jsp" %>
    <div id="container">
    	<ul class="liebiao">
            <c:forEach items="${dataList}" var="content" varStatus="status">
	            <li>
	                <a href="${ctx}/site/shangpin_x.jsp?id=${content.ID}">
		                <c:if test="${content.TITLE_IMG !=null && content.TITLE_IMG !=''}">
		                    <img src="${ctx}${content.TITLE_IMG}.s.jpg"/>
		                </c:if>
	                    <span style="font-weight:700;overflow:hidden;">${content.TITLE}</span>
	                    <div><span class="left price">￥${content.PRICE}</span></div>
		                <div><span class="right small"><fmt:formatDate value="${content.UPDATE_TIME}" pattern="yyyy-MM-dd"/></span></div>
	                </a>
	            </li>
            </c:forEach>
        </ul>
    </div>
    <%@ include file="/site/footer.jsp" %>
</div>
</body>
<%@ include file="/site/js.jsp" %>
</html>